package org.bioversityinternational.mgbms.model.domain;

// Generated 13 oct. 2011 12:11:05 by Hibernate Tools 3.4.0.CR1

import javax.persistence.AttributeOverride;
import javax.persistence.AttributeOverrides;
import javax.persistence.Column;
import javax.persistence.EmbeddedId;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.UniqueConstraint;

/**
 * Mtsmaterial generated by hbm2java
 */
@Entity
@Table(name = "MTSMaterial", schema = "dbo", catalog = "imgbms", uniqueConstraints = @UniqueConstraint(columnNames = {
		"MTSMaterialId", "ChildId" }))
public class Mtsmaterial implements java.io.Serializable {

	private MtsmaterialId id;
	private Material materialByChildId;
	private Material materialByMtsmaterialId;

	public Mtsmaterial() {
	}

	public Mtsmaterial(MtsmaterialId id, Material materialByChildId,
			Material materialByMtsmaterialId) {
		this.id = id;
		this.materialByChildId = materialByChildId;
		this.materialByMtsmaterialId = materialByMtsmaterialId;
	}

	@EmbeddedId
	@AttributeOverrides({
			@AttributeOverride(name = "id", column = @Column(name = "Id", nullable = false)),
			@AttributeOverride(name = "mtsmaterialId", column = @Column(name = "MTSMaterialId", nullable = false)),
			@AttributeOverride(name = "childId", column = @Column(name = "ChildId", nullable = false)) })
	public MtsmaterialId getId() {
		return this.id;
	}

	public void setId(MtsmaterialId id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "ChildId", nullable = false, insertable = false, updatable = false)
	public Material getMaterialByChildId() {
		return this.materialByChildId;
	}

	public void setMaterialByChildId(Material materialByChildId) {
		this.materialByChildId = materialByChildId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "MTSMaterialId", nullable = false, insertable = false, updatable = false)
	public Material getMaterialByMtsmaterialId() {
		return this.materialByMtsmaterialId;
	}

	public void setMaterialByMtsmaterialId(Material materialByMtsmaterialId) {
		this.materialByMtsmaterialId = materialByMtsmaterialId;
	}

}
